package com.zheng.study.company.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 职责
 * ============================================================================
 * author : dzw
 * createDate:  2018/11/13 。
 * ============================================================================
 */
//@Entity
//@Table(name="sys_duty")
public class Duty extends CompanyEntity {
	private static final long serialVersionUID = 4706657209649536597L;

	/**
	 * 用户
	 */
	private User user;
	/**
	 * 职权
	 */
	private Power power;
	/**
	 * 是否是主要职位
	 */
	private int isMain;

	public Duty() {
		super();
	}

	public Duty(User user, Power power) {
		super();
		this.user = user;
		this.power = power;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	public Power getPower() {
		return power;
	}

	public void setPower(Power power) {
		this.power = power;
	}

	public int getIsMain() {
		return isMain;
	}

	public void setIsMain(int isMain) {
		this.isMain = isMain;
	}
}
